/*
 * @Description:
 * @Author:
 * @Date: 2024-10-17 23:10:20
 * @LastEditTime: 2024-12-03 00:10:51
 * @LastEditors: XXX
 */
import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import vueDevTools from 'vite-plugin-vue-devtools'
import dayjs from 'dayjs'
const time = dayjs().format('YYYY-M-D HH:mm:ss')

// https://vite.dev/config/
export default defineConfig({
  define: {
    VITE_GLOBAL_TEST_STRING: '123456789123456',
    'import.meta.env.VUE_APP_UPDATE_TIME': JSON.stringify(time)
  },
  plugins: [
    vue(),
    vueJsx(),
    vueDevTools(),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `
          @import "src/styles/_mixins.scss";
          @import "src/styles/_variable.scss";
        `
      }
    }
  }
})
